package main

import (
	"context"
	"douyin/idl/repository/favorite"
	"fmt"
	"google.golang.org/grpc"
	"net"
)

type FAVORITE struct {
}

func (FAVORITE) FavoriteAction(c context.Context, f *favorite.FavoriteRequest) (*favorite.FavoriteResponse, error) {
	fmt.Println("调用关注微服务FavoriteAction方法")
	return &favorite.FavoriteResponse{
		StatusCode: 0,
		StatusMsg:  nil,
	}, nil
}

func (FAVORITE) IsFavorite(c context.Context, f *favorite.IsFavoriteRequest) (*favorite.IsFavoriteResponse, error) {
	return &favorite.IsFavoriteResponse{}, nil
}
func (FAVORITE) CountFavorite(c context.Context, f *favorite.CountFavoriteRequest) (*favorite.CountFavoriteResponse, error) {
	return &favorite.CountFavoriteResponse{}, nil
}
func (FAVORITE) CountUserFavorite(c context.Context, f *favorite.CountUserFavoriteRequest) (*favorite.CountUserFavoriteResponse, error) {
	return &favorite.CountUserFavoriteResponse{}, nil

}
func (FAVORITE) CountUserTotalFavorited(ctx context.Context, f *favorite.CountUserTotalFavoritedRequest) (*favorite.CountUserTotalFavoritedResponse, error) {
	return &favorite.CountUserTotalFavoritedResponse{}, nil
}
func FInit() {
	server := grpc.NewServer()
	fmt.Println("favorite微服务服务端启动，监听端口：8082")
	favorite.RegisterFavoriteServiceServer(server, &FAVORITE{})

	listen, _ := net.Listen("tcp", "127.0.0.1:8082")

	server.Serve(listen)

}
func main() {
	FInit()
}
